package com.hca.training.zk.javabasic.generic;

import java.lang.reflect.Field;

public class TestgetZhujie {
    public static void main(String[] args) {
        Testgeneric a=new Testgeneric();//试用类
         query(a);
    }
    private static void query(Object f) {
        StringBuilder sb = new StringBuilder();
        //1.获取到class
        Class c = f.getClass();
        Field[] fArray = c.getDeclaredFields();
        for (Field field : fArray) {
            //4.处理每个字段对应的sql
            //4.1.拿到字段名
            boolean fExists = field.isAnnotationPresent(FieldAnnotation.class);
            if (!fExists) {
                continue;
            }
            FieldAnnotation column = field.getAnnotation(FieldAnnotation.class);
            String columnName = column.jdbcType();
            //4.2.拿到字段的值
            String filedName = field.getName();
            System.out.println("注解参数："+columnName);
        }
    }
}
